package com.train.DIP;

import com.train.DIP.message.Email;
import com.train.DIP.message.QQ;
import com.train.DIP.message.WeChat;

/**
 * 依赖倒转原则（Dependency Inversion Principle, DIP）：
 * 要依赖于抽象，不要依赖于具体。换言之，要针对接口编程，不要针对类实例编程。
 * 高层模块不应该依赖低层模块，它们都应该依赖其抽象；抽象不应该依赖细节，
 * 细节应该依赖抽象。
 * */
public class Main {
    public static void main(String[] args) {
        Student student = new Student();
        Email email = new Email();
        QQ qq = new QQ();
        WeChat weChat = new WeChat();
        student.sendEmailInfo(email);
        student.getEmailInfo(email);
        student.sendQQInfo(qq);
        student.getQQInfo(qq);
        student.sendWeChatInfo(weChat);
        student.getWeChatInfo(weChat);
    }
}
